package com.cheap.common.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
    /**
     * 处理全局异常
     */
    @ExceptionHandler(RuntimeException.class)
    public String handleBaseException(RuntimeException e) {
        log.error("有异常哥们：{},{}", e.getCause(), e.getMessage());
        return e.getMessage();
    }
}
